/**
 *
 *
 * 
 *
 * 
 */

package io.dbw.modules.app.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 用户
 *
 * 
 */
@Data
@TableName("sys_user")
public class UserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 用户ID
	 */
	@TableId
	@ApiModelProperty(value = "用户ID",required = true)
	private Long userId;

	/**
	 * 用户名
	 */
	@NotBlank(message="用户名不能为空")
	@ApiModelProperty(value = "用户名",required = true)
	private String userName;

	/**
	 * 密码
	 */
//	@NotBlank(message="密码不能为空")
	@ApiModelProperty(value = "密码",required = true)
	private String password;



	/**
	 * 邮箱
	 */
//	@NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
//	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
	@ApiModelProperty(value = "邮箱")
	private String email;

	/**
	 * 手机号
	 */
	@NotBlank(message="手机号不能为空" )
	@ApiModelProperty(value = "手机号",required = true)
	private String mobile;

	/**
	 * 状态  0：禁用   1：正常
	 */
	@ApiModelProperty(value = "状态;0:禁用,1:正常",required = true)
	private Integer status;

	/**
	 * 角色ID列表
	 */
	@TableField(exist=false)
	@ApiModelProperty(value = "角色ID列表集合",required = true)
	@NotEmpty(message = "角色不能为空")
	private List<Long> roleIdList;


	/**
	 * 创建者ID
	 */
	@ApiModelProperty(value = "创建者ID")
	private Long createBy;

	/**
	 * 创建时间
	 */
	@JsonFormat(shape=JsonFormat.Shape.STRING, timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间")
	private Date createTime;


}
